<template>
	<!-- 组件的结构 -->
	<div class="app">
		<h1>我是App组件</h1>
		<button @click="show">点我试一试在组件标签上加ref</button>
		<Student ref="xuesheng"/>
	</div>
</template>

<script>
	import Student from './components/Student.vue'

	//定义并暴露一个组件的配置
	export default {
		name:'App',
		components:{Student},
		data() {
			return {
				msg:'欢迎学习Vue!',
			}
		},
		methods: {
			show(){
				console.log(this.$refs.xuesheng)
			}
		},
	}
</script>

<style>
	.app{
		background-color: gray;
		padding: 20px;
	}
</style>
